<?php
class Blog extends Controller implements IController {
	public function Main() {
		// If there is no installation found, tell the view to
		// show us the installation link.
		if($this->model->CheckInstallation() == false) {
			$this->assign('isInstalled', false);
		} else {
			$this->assign('isInstalled', true);
			if($this->post('addEntry')) {
				$this->model->addEntry($this->post('blog_title'), $this->post('blog_text'));
			}
			$this->assign('BlogEntries', $this->model->getBlogEntries());
		}
		$this->view('blog_example/blogmain');
	}
	public function Install() {
		$this->assign('InstallDone', $this->model->Install());
		$this->view('blog_example/bloginstall');
	}
	public function Uninstall() {
		$this->assign('UnInstallDone', $this->model->Uninstall());
		$this->view('blog_example/bloginstall');
	}
}
?>